import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowEvent;
import java.awt.event.WindowFocusListener;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-04-23
 * Time:14:08
 */
public class Text1 {
    public static void main(String[] args) {
        Frame frame=new Frame();
        frame.setBounds(400,200,500,500);
        frame.setVisible(true);
        frame.setLayout(null);

        Label kk=new Label("账户:");
        kk.setFont(new Font("宋体",Font.BOLD,25));
        kk.setBounds(100,100,60,50);
        frame.add(kk);
        TextField kk4=new TextField();
        kk4.setBounds(170,100,200,48);
        frame.add(kk4);

        Label kk1=new Label("密码：");
        kk1.setBounds(100,170,60,50);
        kk1.setFont(new Font("宋体",Font.BOLD,25));
        frame.add(kk1);

        TextField kk3=new TextField();
        kk3.setBounds(170,170,200,48);
        frame.add(kk3);


        Button kk5=new Button("注册");
        kk5.setBounds(150,250,50,48);
        frame.add(kk5);
        Button kk6=new Button("登录");
        kk6.setBounds(250,250,50,48);
        frame.add(kk6);

        frame.addWindowFocusListener(new WindowFocusListener() {
            @Override
            public void windowGainedFocus(WindowEvent e) {
                System.exit(0);
            }

            @Override
            public void windowLostFocus(WindowEvent e) {

            }
        });
    }
}
